package com.j.lemon.learn.asiainfo;

import java.io.OutputStream;
import java.net.InetAddress;
import java.net.Socket;

/**
 * @Author lijunjun
 * @Date 2020-06-17 19:47
 * @Description
 */
public class TcpSend {
    public static void main(String[] args) throws Exception {
        //创建Socket对象
        Socket s = new Socket(InetAddress.getByName("127.0.0.1"),6666);
        //获取输出流对象
        OutputStream os = s.getOutputStream();
        String str = "<85>charGate:optTime=20200611150731,sessionId=489508782-721519661620257,sessionIdPa=hXlBJXJRJ7mkGrvndvBqDFylB2nSb1WqzTtp2y1vqGH4cPXgTxR0!-1170965339!1410847889067,pracct=dingyi,slacct=foura,srcIP=192.168.62.113,srcMAC=00:24:E8:AE:28:B6,srcHost=PC-DING,dstIP=192.168.32.204,dstPort=22,dstName=db204,dstId=1791,dstHost=host204,oper=ls,operProtocol=SSH,operDir=/home/foura,result=0,despCmd=ls t,extJson=JTdCJTIyb3BlclJlc3AlMjIlM0ElMjJ0MSUyMHQyJTIyJTdE,errMsg=,workOrder=,workOrderType=,fromSys=UGATE\n";
        //发送数据
        os.write(str.getBytes());
        //释放
        s.close();

    }
}
